package com.project.demo.entity;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;

/**
 * @author Corgile
 * @date 2022-02-18
 * @description: @Component 是为说明这是一个spring组件，以达到注入（@AutoWired）的目的
 * */
@Component
public class Book {
	@Value("${book.name}")
	private String name;
	@Value("${book.some}")
	private float some;

	public Book() { }

	@Value("${book.other}")
	private Integer other;

	@Override
	public String toString() {
		return "Book{" +
				"name='" + name + '\'' +
				", some=" + some +
				", other=" + other +
				'}';
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public float getSome() {
		return some;
	}

	public void setSome(float some) {
		this.some = some;
	}

	public Integer getOther() {
		return other;
	}

	public void setOther(Integer other) {
		this.other = other;
	}

	public Book(String name, float some, Integer other) {
		this.name = name;
		this.some = some;
		this.other = other;
	}
}
